<template>
  <div>
    Home组件
    <el-button type="info" @click="logout">
      退出
    </el-button>
  </div>
</template>

<script>
export default {
  methods: {
    //只要清空了token就等同于退出了
    logout() {
      window.sessionStorage.clear();
      this.$router.push("/login");
    }
  }
};
</script>

<style lang="less"></style>
